package com.neusoft.neuiotms.dcom.repository.hn;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;

import com.neusoft.neuiotms.dcom.model.enums.HnInspectionTaskStatus;
import com.neusoft.neuiotms.dcom.model.hn.HnInspectionTask;

public interface HnInspectionTaskRepository
        extends JpaRepository<HnInspectionTask, Long>, CustomizedHnInspectionTaskRepository {

    List<HnInspectionTask> findByUserCodeAndStatus(String userCode, HnInspectionTaskStatus status);

    int countByUserCodeAndStatusIn(String userCode, List<HnInspectionTaskStatus> status);

    int countByInstitutionCodeInAndStatusIn(List<String> institutions, List<HnInspectionTaskStatus> status);

    int countByStatusIn(List<HnInspectionTaskStatus> status);

    HnInspectionTask findFirstByInstitutionCodeAndStatusOrderByUpdateTimeDesc(String institutionCode,
            HnInspectionTaskStatus status);
}
